package com.yfp.tissue.mapper;

import com.yfp.common.datascope.annotation.DataScope;
import com.yfp.system.api.domain.SysDictData;
import com.yfp.tissue.domain.Dto.CompanyDto;
import com.yfp.tissue.domain.Dto.CompanyFindListDTO;
import com.yfp.tissue.domain.entity.Company;
import com.yfp.tissue.domain.vo.CompanyListVO;
import com.yfp.tissue.domain.vo.CompanyVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface CompanyMapper {


    void insert(Company company);

    @DataScope(deptAlias = "cp")
    List<CompanyVO> queryAllByLimit(CompanyDto companyDto);

    int update(CompanyDto company);

    List<CompanyVO> queryNameList(String companyId);

    List<CompanyVO> queryParen(@Param("companyId") String companyId, @Param("enable") String enable);


    List<SysDictData> selectDict(String type);

    CompanyVO oneNameList(String companyId);

    @DataScope(deptAlias = "cp")
    List<CompanyVO> findList(CompanyFindListDTO companyFindListDTO);

    Company queryById(String companyId);

    List<CompanyVO> queryParenCompany(String companyId);

    List<CompanyListVO> queryCompanyList();

    List<CompanyVO> queryName(@Param("list") List<Long> list);

    void add(Company company);

    /**
     * 根据公司账号获取公司信息
     *
     * @param companyAccount
     * @return
     */
    Company findByCompanyAccount(String companyAccount);

    /**
     * 删除公司
     *
     * @param id
     */
    void del(String id);

    /**
     * 获取公司信息
     *
     * @param companyDto
     */
    @DataScope(deptAlias = "c")
    List<CompanyVO> queryByReq(CompanyDto companyDto);
}
